package cn.com.bluemoon.common.permission;


import cn.com.bluemoon.common.KeyAnnotationClz;
import cn.com.bluemoon.common.UserPermission;
import cn.com.bluemoon.daps.model.entity.DapDataModelRecord;

import java.lang.annotation.Documented;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

@Inherited
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface ModelEdit {

    // 模型id
    String key() default "id";

    Class<DapDataModelRecord> record() default DapDataModelRecord.class;;

    /**
     * 定义{@link UserPermission.SingleRow#key()}对应的注解
     *
     * @return
     */
    KeyAnnotationClz keyFormClz();

    /**
     * 增加功能描述，用于返回前端错误提示
     * @return
     */
    String errorMsg() default "当前模型处于发布流程中，不允许编辑";

}
